package com.zpark.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

/**
 * @PackageName: com.zpark.controller
 * @ClassName: UserController
 * @Description:
 * @author: RZS
 * @date: 2023/4/10  15:54
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @PostMapping("/login/{name}/{passwd}")
//    @GetMapping  只能处理get请求
//    @DeleteMapping 只能处理delete请求
//    @PutMapping  只能处理put请求
    public String login(Model model,
                        @PathVariable("name") String username,
                        @PathVariable("passwd") String pwd){
        model.addAttribute("uname", username);
        model.addAttribute("pwd", pwd);

        return "login";
    }
}
